<template>
	<view class="order-wrap page-bg">
		<view class="success-header">
			<image class="success-icon" src="../../static/common/icon_12.png" mode=""></image>
			<view class="success-title">商品购买成功</view>
			<view class="success-info">请耐心等待商家发货</view>
		</view>
		
		<view class="success-solt" v-if="info">
			<view class="address-name">
				<text>{{info.realName}}</text>
				<text>{{info.phoneNumber}}</text>
			</view>
			<view class="address-add desc">{{info.address}}</view>
			<view class="line-info">
				<view class="line-info__title">实付金额</view>
				<view class="line-info__con yuan price">{{info.orderPrice | formatMoney}}</view>
			</view>
		</view>
		
		<view class="btns">
			<view class="btn" v-if='type==="team"' @click="link('/pages/mine/orderTeamDetail?id='+info.orderId)">订单详情</view>
			<view class="btn" v-else @click="link('/pages/mine/orderDetail?id='+info.orderId)">订单详情</view>
			<view class="btn btn-back" @click="switchUrl('/pages/index/index')">返回首页</view>
		</view>
	</view>
</template>

<script>
	import common from '../../utils/common.js'
	export default {
		data() {
			return {
				info: {},
				type: 'order'
			}
		},
		onLoad(options) {
			let info = common.getStorage('orderInfo')
			this.type = options.type || 'order'
			this.info = info
		},
		methods: {
			link(url) {
				this.$link(url)
			},
			switchUrl(url) {
				uni.switchTab({
					url
				})
			},
		}
	}
</script>

<style scoped lang="less">
	@import url('../../app.less');
	.order-wrap{
		.content-30;
	}
	.success-header{
		padding-top: 50rpx;
		.flex-base;
		flex-direction: column;
		justify-content: center;
		.success-icon{
			width: 100rpx;
			height: 100rpx;
			display: block;
		}
		.success-title{
			font-size: 34rpx;
			padding: 30rpx 0 20rpx 0;
		}
		.success-info{
			.f24;
			color: @font-orange-color;
		}
		
	}
	.success-solt{
		margin-top: 50rpx;
		padding: 0 20rpx;
		padding-top: 20rpx;
		box-sizing: border-box;
		.br;
		background-color: @f;
		margin-bottom: 80rpx;
		.address-name {
			.fw;
			.f32;
			width: 100%;
			text {
				padding-right: 20upx;
			}
		}
		.address-add{
			padding-top: 10rpx;
			padding-bottom: 20rpx;
		}
		
		.line-info{
			border-top: 1px solid @border-color;
			.flex-base;
			height: 100upx;
			border-bottom: 1px solid @border-color;
		}
	}
	
	.btns{
		.flex-base;
		justify-content: space-around;
		.btn{
			padding: 0 40rpx;
		}
		.btn-back{
			border: 1px solid #ddd;
			background-color: #f0f0f0;
			color: @font-base-color;
		}
	}
</style>
